package com.youease.chris.model.proxy
{
	import com.youease.chris.model.vo.MapData;
	import com.youease.chris.model.vo.ProjectData;
	
	import org.puremvc.as3.interfaces.IProxy;
	import org.puremvc.as3.patterns.proxy.Proxy;
	
	public class ProjectDataProxy extends Proxy implements IProxy
	{
		public static const NAME:String = "ProjectDataProxy";
		
		public function ProjectDataProxy(data:Object)
		{
			super(NAME, data);
		}
		
		public function addMap(mapData:MapData):void {
			for each(var map:MapData in projectData.maps) {
				if(map.name == mapData.name) {
					mapData.name += "_1";
				}
			}
			this.projectData.maps.push(mapData);
		}
		
		public function get projectData():ProjectData {
			return this.data as ProjectData;
		}
	}
}